callback(WebSQLStorage.wrapSQLError(sqlError), null);
export module WebSQLStorage { export class LoadStorage implements attached.LoadStorage { public editedUTC: number,
load(recipient: LoadStorageRecipient) { if (typeof this.editedUTC !== 'number'){ recipient.completed(new UpdateStorage(this._db));
this._db.readTransaction(
'SELECT tbl_name from sqlite_master WHERE type=\'table\'',
(transaction, result) => { this._processTableNames(transaction, result, recipient);
(transaction, sqlError) =>
recipient.completed(new UpdateStorage(this._db)));
sqlError => recipient.failed(wrapSQLError(sqlError)));
migrate(filesByName: { [name: string]: { [name: string]: string; }; }, callback: (error: Error, updater: attached.UpdateStorage) => void) { this._dropAllTables(transaction);
var validTableNames: { [name: string]: boolean; } = {}; for (var file in filesByName) if (filesByName.hasOwnProperty(file)) { var properties = filesByName[file];
for (var propertyName in properties) if (properties.hasOwnProperty(propertyName)) { var value = properties[propertyName];
sqlError => callback(wrapSQLError(error), null));
private _dropAllTables(transaction: SQLTransaction, callback: (error: SQLError) => void) { private _processTableNames(transaction: SQLTransaction, result: SQLResultSet, recipient: LoadStorageRecipient) { var length = result && result.rows ? result.rows.length : 0;
var ftab = this._extractFileNames(result);
recipient.completed(new UpdateStorage(this._db));
var reportedFileCount = 0;